import request from "@/utils/request";
import qs from "qs";
// 任务详细
export function getPost_courseTask(postId) {
  return request({
    url: "/manager/courseTask/taskTemporary/" + postId,
    method: "get",
  });
}
// 任务删除
export function delPost_courseTask(postId) {
  return request({
    url: "/manager/courseTask/temporary/" + postId,
    method: "delete",
  });
}
// 任务新增
export function addPost_courseTask(data) {
  return request({
    url: "/manager/courseTask/temporary",
    method: "post",
    data: data,
  });
}

// 任务修改
export function updatePost_courseTask(data) {
  return request({
    url: "/manager/courseTask/temporary",
    method: "put",
    data: data,
  });
}
// 任务修改名称
export function updatePost_courseTaskName(data) {
  return request({
    url: "/manager/courseTask/temporaryName",
    method: "put",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: data,
  });
}
// 任务排序
export function sort_courseTask(data) {
  return request({
    url: "/manager/courseTask/temporary/sort",
    method: "post",
    data: data,
  });
}

// ---------------------------------------
// 环节排序
export function sort_courseTaskContent(data) {
  return request({
    url: "/manager/courseTask/contentTemporary/sort",
    method: "post",
    data: data,
  });
}
// 环节列表
export function listPost_courseTaskContent(query) {
  return request({
    url: "/manager/courseTask/contentTemporary/list",
    method: "get",
    params: query,
  });
}
// 环节详细
export function getPost_courseTaskContent(postId) {
  return request({
    url: "/manager/courseTask/contentTemporary/" + postId,
    method: "get",
  });
}
// 环节新增
export function addPost_courseTaskContent(data) {
  return request({
    url: "/manager/courseTask/contentTemporary",
    method: "post",
    data: data,
  });
}

// 环节修改
export function updatePost_courseTaskContent(data) {
  return request({
    url: "/manager/courseTask/contentTemporary",
    method: "put",
    data: data,
  });
}

// 环节删除
export function delPost_courseTaskContent(postId) {
  return request({
    url: "/manager/courseTask/contentTemporary/" + postId,
    method: "delete",
  });
}

// 附件新增
export function addPost_file(data) {
  return request({
    url: "/manager/courseTask/fileTemporary",
    method: "post",
    data: data,
  });
}
// 附件列表
export function listPost_file(query) {
  return request({
    url: "/manager/courseTask/fileTemporary/list",
    method: "get",
    params: query,
  });
}
// 附件删除
export function delPost_file(postId) {
  return request({
    url: "/manager/courseTask/fileTemporary/" + postId,
    method: "delete",
  });
}
